﻿<%@ Page Title="" Language="C#" Async="true" MasterPageFile="~/car-insurance/proposalforms/CarInsuranceProposalMasterPage.master"
    AutoEventWireup="true" CodeFile="lmg-proposal-form.aspx.cs" EnableEventValidation="false"
    Inherits="car_insurance_proposalforms_lmg_proposal_form" %>

<%@ Register Src="~/controls/usrNoJS.ascx" TagName="usrNoJS" TagPrefix="ucNoJS" %>
<%@ Register Src="~/controls/usrMobilePhone.ascx" TagName="usrPhoneNo" TagPrefix="uc1" %>
<%@ Register Src="~/controls/usrDate.ascx" TagName="usrDate" TagPrefix="uc2" %>
<%@ Register Src="~/controls/usrOccupation.ascx" TagName="usrOccupation" TagPrefix="uc10" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <!--jQuery Sticky-header-->

    <script type="text/javascript">
        $(function() {
            var bar = $('#headerSlideContainer');
            var top = bar.css('top');
            $(window).scroll(function() {
                if ($(this).scrollTop() > 50) {
                    bar.stop().animate({ 'top': '0px' }, 200);
                } else {
                    bar.stop().animate({ 'top': top }, 200);
                }
            });
        });
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <ucNoJS:usrNoJS ID="usrNoJS1" runat="server" />
    <div id="divLoading">
        <table style="width: 100%; height: 600px">
            <tr>
                <td align="center" valign="middle">
                    <img src="/images/loader/loader-main.gif" alt="Loading" align="absmiddle" />
                    <span id="divMessage">Please wait...</span><span id="divPgrPercent">0%</span>
                </td>
            </tr>
        </table>
    </div>
    <div style="display: none">
        <h3>
            <asp:Label ID="lblProvider" runat="server"></asp:Label></h3>
        <asp:Label ID="lblPackageHead" runat="server" Text="WorkShop Plan : "></asp:Label>
        <asp:Label ID="lblPackage" runat="server"></asp:Label>
        <asp:Label ID="lblPremiumHead" runat="server" Text="Annual Premium : "></asp:Label>
        <asp:Label ID="lblPremium" runat="server"></asp:Label>
        <asp:Label ID="lblRedirect" runat="server"></asp:Label>
    </div>
    <div runat="server" id="divAgentRequest" visible="false">
        Agent ID :<asp:Label ID="lblAgentId" runat="server" />
        Car ID :<asp:Label ID="lblCarId" runat="server" />
        Customer ID:
        <asp:Label ID="lblCustomerId" runat="server" />
        Car Result ID :<asp:Label ID="lblCarResultId" runat="server" />
        Provider Company ID :<asp:Label ID="lblProviderCompanyId" runat="server" />
        Car More Detail ID:<asp:Label ID="lblCarMoreDetailId" runat="server" />
        Customer Name:<asp:Label ID="lblCustomerGivenName" runat="server" />
        Mobile No:<asp:Label ID="lblCustomerMobileNo" runat="server" />
    </div>
    <div id="divContent" style="display: none;">
        <div id="headerSlideContainer">
            <div class="header">
                <div class="logo">
                    <input type="button" class="back-btn" value="<%$Resources:General,Back %>" onclick="LeaveConfirm()" ID="btnBackTop" runat="server" /></div>
                <div class="phone-days">
                </div>
                <div class="flag-th">
                    <img src="/images/gg-logo/gg-logo-small.png" width="68" height="62" alt="" /></div>
            </div>
        </div>
        <div id="wrapper">
            <div class="header">
                <div class="logo">
                    <input type="button" class="back-btn" value="<%$Resources:General,Back %>" onclick="LeaveConfirm()" ID="btnBackHead" runat="server" /></div>
                <div class="phone-days">
                </div>
                <div class="flag-th">
                    <img src="/images/gg-logo/gg-logo-small.png" width="68" height="62" alt="" /></div>
            </div>
        </div>
        <div class="grey-bg-compare">
            <div class="radius-box-proposal">
                <div class="steps">
                    <%--<div style="float: left">
                        <asp:Image ImageUrl="<%$ Resources:ImageResource,ImgSteps1ActiveUrl%>" Width="165" Height="33" alt="" ID="imgStp1" runat="server" />
                    </div>
                    <div style="float: left; padding-right: 3px;">
                        <asp:Image ImageUrl="<%$ Resources:ImageResource,ImgSteps2ActiveUrl%>" Width="165" Height="33" alt="" ID="imgStp2" runat="server" />
                    </div>
                    <div style="float: left">
                        <asp:Image ImageUrl="<%$ Resources:ImageResource,ImgSteps3ActiveUrl%>" Width="165" Height="33" alt="" ID="imgStp3" runat="server" />
                    </div>--%>
                    <div>
                        <asp:Image ImageUrl="<%$ Resources:ImageResource,ImgStep3Url%>" Width="412" Height="123"
                            alt="" ID="imgStep" runat="server" />
                    </div>
                </div>
                <div id="divAgent" style="font-size: small; font-weight: bold" runat="server" visible="false">
                    <br />
                    Agent Name :
                    <asp:Label runat="server" ID="lblAgentName" />
                    <asp:HyperLink runat="server" onclick="return confirm('Are you confirm?');" ID="hplLogout"
                        Text="Sign Out" NavigateUrl="~/user/logout.aspx" />
                </div>
                <div class="monkey-head">
                </div>
                <div class="pro-form-head">
                    <div class="proposal-heading-big">
                        <%=GetGlobalResourceObject("ProposalForm", "AppFormHeader")%></div>
                    <div class="pf-col-full top10">
                        <strong>
                            <%=GetGlobalResourceObject("ProposalForm", "CarMakeModel")%></strong><br />
                        <asp:Label ID="lblCarMakemodel" runat="server"></asp:Label>
                    </div>
                    <div class="pf-col-full top10">
                        <div class="pf-col-1">
                            <span class="tx-bold">
                                <asp:Label ID="lblInsurance" Text="<%$ Resources:ProposalForm,SelectedInsurer%>"
                                    runat="server"></asp:Label></span><br />
                            <asp:Label ID="lblSelectInsurer" runat="server"></asp:Label><br />
                            <br />
                            <span class="tx-bold">
                                <%=GetGlobalResourceObject("ProposalForm", "QuoteReferenceNumber")%></span><br />
                            <asp:Label ID="lblQRefNo" runat="server"></asp:Label><br />
                            <br />
                            <span class="tx-bold">
                                <asp:Label ID="lblPackageName" Text="<%$ Resources:ProposalForm,Package%>" runat="server"></asp:Label></span><br />
                            <asp:Label ID="lblPackages" runat="server"></asp:Label><br />
                        </div>
                        <div class="pf-col-2">
                            <span class="tx-bold">
                                <%=GetGlobalResourceObject("ProposalForm", "CarModelYear")%></span><br />
                            <asp:Label ID="lblCarModelYear" runat="server"></asp:Label>
                            <br />
                            <br />
                            <span class="tx-bold">
                                <%=GetGlobalResourceObject("ProposalForm", "SumInsured")%></span><br />
                            <asp:Label ID="lblSumInsured" runat="server"></asp:Label>
                            <br />
                            <br />
                        </div>
                        <div style="display: none;">
                            <asp:TextBox ID="txtPremium" runat="server"></asp:TextBox>
                            <asp:TextBox ID="txtIsIncludeCMI" runat="server" Text="0"></asp:TextBox>
                            <asp:Label ID="lblCommencementdate" runat="server"></asp:Label>
                            <span class="tx-bold">
                                <%=GetGlobalResourceObject("ProposalForm", "Premium")%></span><br />
                            <asp:Label ID="lblPremiums" runat="server"></asp:Label>
                        </div>
                        <div class="pf-col-3">
                            <table width="85%" border="0" cellspacing="3" cellpadding="3" class="table-pro-form ">
                                <tr>
                                    <td>
                                        <span class="tx-bold"><%=GetGlobalResourceObject("CarInsuranceResultPage", "Type")%></span>
                                    </td>
                                    <td align="right">
                                        <span class="tx-bold"><%=GetGlobalResourceObject("CarInsuranceResultPage", "Price")%>
                                        (<%=GetGlobalResourceObject("CarInsurance", "Baht")%>) </span>
                                    </td>
                                </tr>
                                <tr id="trBeforeCMI" runat="server">
                                    <td>
                                        <asp:Label ID="lblBeforeCMITitle" runat="server"></asp:Label>
                                    </td>
                                    <td align="right">
                                        <asp:Label ID="lblBeforeCMI" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr id="trCMI" runat="server">
                                    <td>
                                        <asp:Label ID="lblCMIAmountTitle" runat="server"></asp:Label>
                                    </td>
                                    <td align="right">
                                        <asp:Label ID="lblCMIAmount" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="lblPremiumTitle" runat="server"></asp:Label>
                                    </td>
                                    <td align="right">
                                        <span class="tx-bold tx-total">
                                            <asp:Label ID="lblPromotion" runat="server"></asp:Label>
                                        </span>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div style="display: none;">
                            <h1>
                                <%=GetGlobalResourceObject("ProposalForm", "NCB")%></h1>
                            <p>
                                <asp:Label ID="lblNCB" runat="server"></asp:Label></p>
                            <h1>
                                Red Plate?</h1>
                            <p>
                                <asp:Label ID="lblRedPlate" runat="server"></asp:Label></p>
                            <h1>
                                CTPL</h1>
                            <p>
                                <asp:Label ID="lblCTPL" runat="server"></asp:Label></p>
                            <h1>
                                Current/Existing NCD</h1>
                            <p>
                                <asp:Label ID="lblNCDvalue" runat="server"></asp:Label></p>
                            <h1>
                                Any Claims in the Last 3 Years?</h1>
                            <p>
                                <asp:Label ID="lblAnyclaim" runat="server"></asp:Label></p>
                            <h1>
                                Add Additional Name Driver</h1>
                            <p>
                                <asp:Label ID="lblAddDriver" runat="server"></asp:Label>
                                <span style="display: none;">
                                    <asp:TextBox ID="txtDriverCount" runat="server" Text="0"></asp:TextBox>
                                </span>
                            </p>
                            <h1>
                                Year of Manufacture</h1>
                            <p>
                                <asp:Label ID="lblYrofManufacture" runat="server"></asp:Label></p>
                        </div>
                    </div>
                    <div class="pf-col-4">
                        <img src="<%=GetGlobalResourceObject("ImageResource", "ImgProposalQSummaryUrl")%>"
                            width="246" height="180" alt="" />
                    </div>
                </div>
                <div id="divValidationSummary" style="padding-left: 20px; padding-right: 20px;">
                    <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label>
                    <asp:ValidationSummary ID="vsproposal" CssClass="error-msg" runat="server" ValidationGroup="proposal"
                        HeaderText="<%$ Resources:Menu,RequiredValidation%>" />
                </div>
                <div class="pro-form">
                    <div class="proposal-heading-big">
                        <%=GetGlobalResourceObject("ProposalForm", "ImportantDisclaimer")%></div>
                    <div>
                        <asp:Label runat="server" ID="lblDisclaimerHeader" Text="<%$ Resources:CarInsuranceProposal,KurniaCIHeader%>"></asp:Label>
                        <br />
                        <asp:Label runat="server" ID="lblDisclaimer" Text="<%$ Resources:CarInsuranceProposal,KurniaCIMessage%>"></asp:Label>
                        <br />
                        <br />
                        <asp:Label runat="server" ID="lblPaymentMessageHeader" Text="<%$ Resources:CarInsuranceProposal,CIPaymentMessageHeader%>"></asp:Label>:
                        <br />
                        <asp:Label runat="server" ID="lblPaymentMessage1" Text="<%$ Resources:CarInsuranceProposal,CIPaymentMessage1%>"></asp:Label>
                        <br />
                        <asp:Label runat="server" ID="lblPaymentMessage2" Text="<%$ Resources:CarInsuranceProposal,CIPaymentMessage2%>"></asp:Label>
                    </div>
                </div>
                <div class="pro-form-row">
                    <div class="proposal-heading">
                        <%=GetGlobalResourceObject("ProposalForm", "ProposerParticulars")%></div>
                    <div class="pro-col-1">
                        <div class="proposal-col">
                            <span style="color: #FF0004">*</span>
                            <%=GetGlobalResourceObject("ProposalForm", "Name")%>:</div>
                        <div class="proposal-row">
                            <asp:TextBox ID="txtName" MaxLength="50" runat="server" size="25" CssClass="proposal-fields"></asp:TextBox>&nbsp;
                            <asp:RequiredFieldValidator ID="rfvName" runat="server" CssClass="validationError"
                                ErrorMessage="" ValidationGroup="proposal" ControlToValidate="txtName"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="revName" runat="server" ControlToValidate="txtName"
                                ValidationExpression="^([\u0000-\uDFFF']{1,50})$|^([a-zA-Z''-'\s]{1,50})$" ValidationGroup="proposal"
                                CssClass="validationError" Text="" ErrorMessage=""></asp:RegularExpressionValidator>
                        </div>
                        <div class="proposal-col">
                            <span style="color: #FF0004">*</span>
                            <%=GetGlobalResourceObject("ProposalForm", "IdentificationNo")%>:</div>
                        <div class="proposal-row">
                            <asp:TextBox ID="txtIdentificationNo" MaxLength="13" runat="server" size="20" CssClass="proposal-fields"></asp:TextBox>&nbsp;
                            <asp:RequiredFieldValidator ID="rfvIdentificationNo" runat="server" CssClass="validationError"
                                ErrorMessage="" ValidationGroup="proposal" ControlToValidate="txtIdentificationNo"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="revIdentificationNo" runat="server" ControlToValidate="txtIdentificationNo"
                                ValidationExpression="^([\u0000-\uDFFF']{1,50})$|^([a-zA-Z''-'\s]{1,50})$" ValidationGroup="proposal"
                                CssClass="validationError" Text="" ErrorMessage=""></asp:RegularExpressionValidator>
                        </div>
                        <div class="proposal-col">
                            <span style="color: #FD0004">*</span>
                            <%=GetGlobalResourceObject("ProposalForm", "Occupation")%>:</div>
                        <div class="proposal-row">
                            <uc10:usrOccupation ID="ddlOccupation" runat="server" IsEnabled="true" Width="240"
                                ValidationGroup="proposal" ErrorMessage="" />
                        </div>
                        <div class="proposal-col">
                            <span style="color: #FF0004">*</span>
                            <%=GetGlobalResourceObject("ProposalForm", "ContactNumber")%>:</div>
                        <div class="proposal-row">
                            <uc1:usrPhoneNo ID="txtContactNo" IsEnabled="true" IsRequired="true" PhoneNoRequireErrorMessage="Require mobile number."
                                PhoneNoErrorMessage="Mobile phone number should 8 digits." PhoneNoValidErrorMessage="Invalid mobile phone number."
                                runat="server" ValidationGroup="proposal" />
                        </div>
                    </div>
                    <div class="pro-col-2">
                        <div class="proposal-col">
                            <%=GetGlobalResourceObject("ProposalForm", "HomeOfficeNumber")%>:</div>
                        <div class="proposal-row">
                            <asp:TextBox ID="txtHomeOfficeNo" runat="server" MaxLength="11" size="25" CssClass="proposal-fields"></asp:TextBox>
                            <div style="font-size: 11px;">
                                <%=GetGlobalResourceObject("General", "MobileExample")%>.</div>
                        </div>
                        <div class="proposal-col">
                            <span style="color: #FF0004">*</span>
                            <%=GetGlobalResourceObject("ProposalForm", "Beneficiary")%>:</div>
                        <div class="proposal-row">
                            <asp:TextBox ID="txtBeneficiaryName" MaxLength="50" runat="server" size="25" CssClass="proposal-fields"></asp:TextBox>&nbsp;
                            <asp:RequiredFieldValidator ID="rfvBeneficiaryName" runat="server" CssClass="validationError"
                                ErrorMessage="" ValidationGroup="proposal" ControlToValidate="txtBeneficiaryName"></asp:RequiredFieldValidator>
                            <asp:RegularExpressionValidator ID="revBeneficiaryName" runat="server" ControlToValidate="txtBeneficiaryName"
                                ValidationExpression="^([\u0000-\uDFFF']{1,50})$|^([a-zA-Z''-'\s]{1,50})$" ValidationGroup="proposal"
                                CssClass="validationError" Text="" ErrorMessage=""></asp:RegularExpressionValidator>
                        </div>
                        <div class="proposal-col">
                            <span style="color: #FF0004">*</span>
                            <%=GetGlobalResourceObject("ProposalForm", "CarPlate")%>:</div>
                        <div class="proposal-row">
                            <asp:TextBox ID="txtCarPlate" MaxLength="50" runat="server" size="25" CssClass="proposal-fields"></asp:TextBox>&nbsp;
                            <asp:RequiredFieldValidator ID="rfvCarPlate" runat="server" CssClass="validationError"
                                ErrorMessage="" ValidationGroup="proposal" ControlToValidate="txtCarPlate"></asp:RequiredFieldValidator>
                        </div>
                        <div class="proposal-col">
                            <span style="color: #FF0004">*</span>
                            <%=GetGlobalResourceObject("ProposalForm", "CarPlateProvince")%>:</div>
                        <div class="proposal-row">
                            <asp:DropDownList ID="ddlCarPlateProvince" runat="server" ToolTip="Choose Car Plate Province"
                                Width="240" CssClass="proposal-combo">
                            </asp:DropDownList>
                            &nbsp;
                            <asp:RequiredFieldValidator ID="rfvCarPlateProvince" runat="server" CssClass="validationError"
                                ErrorMessage="" ValidationGroup="proposal" ControlToValidate="ddlCarPlateProvince"
                                InitialValue="-1" Text=""></asp:RequiredFieldValidator>
                        </div>
                    </div>
                </div>
                <div class="pro-form-row">
                    <div class="proposal-heading">
                        <%=GetGlobalResourceObject("ProposalForm", "PresentAddress")%></div>
                    <div id="divAddress">
                        <div class="pro-col-1">
                            <div class="proposal-col">
                                <span style="color: #FF0004">*</span>
                                <%=GetGlobalResourceObject("ProposalForm", "PresentAddress")%>:</div>
                            <div class="proposal-row">
                                <asp:TextBox ID="txtPresentAddress" MaxLength="350" runat="server" size="25" CssClass="proposal-fields"></asp:TextBox>&nbsp;
                                <asp:RequiredFieldValidator ID="rfvPresentAddress" runat="server" CssClass="validationError"
                                    ErrorMessage="" ValidationGroup="proposal" ControlToValidate="txtPresentAddress"></asp:RequiredFieldValidator>
                            </div>
                            <div class="proposal-col">
                                <span style="color: #FF0004">*</span>
                                <%=GetGlobalResourceObject("ProposalForm", "Province")%>:</div>
                            <div class="proposal-row">
                                <asp:DropDownList ID="ddlProvince" runat="server" ToolTip="Choose Province" Width="240"
                                    CssClass="proposal-combo">
                                </asp:DropDownList>
                                &nbsp;
                                <asp:RequiredFieldValidator ID="rfvProvince" runat="server" CssClass="validationError"
                                    ErrorMessage="" ValidationGroup="proposal" ControlToValidate="ddlProvince" InitialValue="-1"
                                    Text=""></asp:RequiredFieldValidator>
                            </div>
                            <div class="proposal-col">
                                <span style="color: #FF0004">*</span>
                                <%=GetGlobalResourceObject("ProposalForm", "District")%>:</div>
                            <div class="proposal-row">
                                <asp:DropDownList ID="ddlDistrict" runat="server" ToolTip="Choose District" Width="240"
                                    CssClass="proposal-combo">
                                </asp:DropDownList>
                                <input type="text" id="hidDistrict" runat="server" style="display: none;" value="-1" />
                                <input type="text" id="hidDistrictName" runat="server" style="display: none;" />
                                &nbsp;
                                <asp:RequiredFieldValidator ID="rfvDistrict" runat="server" CssClass="validationError"
                                    ErrorMessage="" ValidationGroup="proposal" ControlToValidate="hidDistrict" InitialValue="-1"
                                    Text=""></asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <div class="pro-col-2">
                            <div class="proposal-col">
                                <span style="color: #FF0004">*</span>
                                <%=GetGlobalResourceObject("ProposalForm", "SubDistrict")%>:</div>
                            <div class="proposal-row">
                                <asp:DropDownList ID="ddlSubDistrict" runat="server" ToolTip="Choose District" Width="240"
                                    CssClass="proposal-combo">
                                </asp:DropDownList>
                                <input type="text" id="hidSubDistrict" runat="server" style="display: none;" value="-1" />
                                <input type="text" id="hidSubDistrictName" runat="server" style="display: none;" />
                                &nbsp;
                                <asp:RequiredFieldValidator ID="rfvSubDistrict" runat="server" CssClass="validationError"
                                    ErrorMessage="" ValidationGroup="proposal" ControlToValidate="hidSubDistrict"
                                    InitialValue="-1"></asp:RequiredFieldValidator>
                            </div>
                            <div class="proposal-col">
                                <span style="color: #FF0003">*</span>
                                <%=GetGlobalResourceObject("ProposalForm", "PostalCode")%>:</div>
                            <div class="proposal-row">
                                <asp:TextBox ID="txtPostalCode" MaxLength="5" runat="server" size="15" CssClass="proposal-fields"></asp:TextBox>&nbsp;
                                <asp:RequiredFieldValidator ID="rfvPostalCode" runat="server" CssClass="validationError"
                                    ErrorMessage="" ValidationGroup="proposal" ControlToValidate="txtPostalCode"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revPostalCode" runat="server" ControlToValidate="txtPostalCode"
                                    ValidationExpression="[0-9]{5}" Display="Dynamic" ValidationGroup="proposal"
                                    CssClass="validationError" Text="" ErrorMessage=""></asp:RegularExpressionValidator>
                            </div>
                            <div class="txt-align">
                                <%=GetGlobalResourceObject("ProposalForm", "IsMailingAddress")%>
                                <asp:RadioButton ID="rdoMailingAddressYes" runat="server" GroupName="mailingaddress"
                                    Checked="true" />
                                &nbsp;<asp:Label ID="lblMailingAddressYes" runat="server" Text="<%$ Resources:ProposalForm,Yes%>"></asp:Label>
                                <asp:RadioButton ID="rdoMailingAddressNo" runat="server" GroupName="mailingaddress" />
                                &nbsp;<asp:Label ID="lblMailingAddressNo" runat="server" Text="<%$ Resources:ProposalForm,No%>"></asp:Label>
                                <input type="text" id="hidMailingAddress" runat="server" style="display: none;" value="no" />
                            </div>
                        </div>
                    </div>
                </div>
                <asp:Panel ID="pnlMailingAddress" runat="server" Width="100%" Style="display: none;">
                    <div class="pro-form-row">
                        <div class="proposal-heading">
                            <%=GetGlobalResourceObject("ProposalForm", "MailingAddress")%></div>
                        <div class="pro-col-1">
                            <div class="proposal-col">
                                <span style="color: #FF0004">*</span>
                                <%=GetGlobalResourceObject("ProposalForm", "MailingAddress")%>:</div>
                            <div class="proposal-row">
                                <asp:TextBox ID="txtMailingAddress" MaxLength="350" runat="server" size="25" CssClass="proposal-fields"></asp:TextBox>&nbsp;
                                <asp:RequiredFieldValidator ID="rfvMailingAddress" runat="server" CssClass="validationError"
                                    ErrorMessage="" ValidationGroup="proposal" ControlToValidate="txtMailingAddress"></asp:RequiredFieldValidator>
                            </div>
                            <div class="proposal-col">
                                <span style="color: #FF0004">*</span>
                                <%=GetGlobalResourceObject("ProposalForm", "Province")%>:</div>
                            <div class="proposal-row">
                                <asp:DropDownList ID="ddlMailingProvince" runat="server" ToolTip="Choose Province"
                                    Width="240" CssClass="proposal-combo">
                                </asp:DropDownList>
                                &nbsp;
                                <asp:RequiredFieldValidator ID="rfvMailingProvince" runat="server" CssClass="validationError"
                                    ErrorMessage="" ValidationGroup="proposal" ControlToValidate="ddlMailingProvince"
                                    InitialValue="-1" Text=""></asp:RequiredFieldValidator>
                            </div>
                            <div class="proposal-col">
                                <span style="color: #FF0004">*</span>
                                <%=GetGlobalResourceObject("ProposalForm", "District")%>:</div>
                            <div class="proposal-row">
                                <asp:DropDownList ID="ddlMailingDistrict" runat="server" ToolTip="Choose District"
                                    Width="240" CssClass="proposal-combo">
                                </asp:DropDownList>
                                <input type="text" id="hidMailingDistrict" runat="server" style="display: none;"
                                    value="-1" />
                                <input type="text" id="hidMailingDistrictName" runat="server" style="display: none;" />
                                &nbsp;
                                <asp:RequiredFieldValidator ID="rfvMailingDistrict" runat="server" CssClass="validationError"
                                    ErrorMessage="" ValidationGroup="proposal" ControlToValidate="hidMailingDistrict"
                                    InitialValue="-1" Text=""></asp:RequiredFieldValidator>
                            </div>
                        </div>
                        <div class="pro-col-2">
                            <div class="proposal-col">
                                <span style="color: #FF0004">*</span>
                                <%=GetGlobalResourceObject("ProposalForm", "SubDistrict")%>:</div>
                            <div class="proposal-row">
                                <asp:DropDownList ID="ddlMailingSubDistrict" runat="server" ToolTip="Choose District"
                                    Width="240" CssClass="proposal-combo">
                                </asp:DropDownList>
                                <input type="text" id="hidMailingSubDistrict" runat="server" style="display: none;"
                                    value="-1" />
                                <input type="text" id="hidMailingSubDistrictName" runat="server" style="display: none;" />
                                &nbsp;
                                <asp:RequiredFieldValidator ID="rfvMailingSubDistrict" runat="server" CssClass="validationError"
                                    ErrorMessage="" ValidationGroup="proposal" ControlToValidate="hidMailingSubDistrict"
                                    InitialValue="-1"></asp:RequiredFieldValidator>
                            </div>
                            <div class="proposal-col">
                                <span style="color: #FF0003">*</span>
                                <%=GetGlobalResourceObject("ProposalForm", "PostalCode")%>:</div>
                            <div class="proposal-row">
                                <asp:TextBox ID="txtMailingPostalCode" MaxLength="5" runat="server" size="15" CssClass="proposal-fields"></asp:TextBox>&nbsp;
                                <asp:RequiredFieldValidator ID="rfvMailingPostalCode" runat="server" CssClass="validationError"
                                    ErrorMessage="" ValidationGroup="proposal" ControlToValidate="txtMailingPostalCode"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="revMailingPostalCode" runat="server" ControlToValidate="txtMailingPostalCode"
                                    ValidationExpression="[0-9]{5}" Display="Dynamic" ValidationGroup="proposal"
                                    CssClass="validationError" Text="" ErrorMessage=""></asp:RegularExpressionValidator>
                            </div>
                        </div>
                    </div>
                </asp:Panel>
                <div class="pro-form-row">
                    <div class="proposal-heading">
                        <%=GetGlobalResourceObject("General", "AdditionalDetails")%></div>
                    <div class="pro-col-1">
                        <div class="proposal-col">
                            <span style="color: #FF0004">*</span><%=GetGlobalResourceObject("CarInsurance", "AnyClaimLastYear")%>:
                        </div>
                        <div class="proposal-row">
                            <asp:RadioButton ID="rdoYesClaimLastYear" runat="server" GroupName="anyclaim"></asp:RadioButton>
                            <asp:Label ID="lblYesClaimLastYear" runat="server" Text="<%$ Resources:ProposalForm,Yes%>"></asp:Label>&nbsp;
                            <asp:RadioButton ID="rdoNoClaimLastYear" runat="server" GroupName="anyclaim" Checked="true">
                            </asp:RadioButton>
                            <asp:Label ID="lblNoClaimLastYear" runat="server" Text="<%$ Resources:ProposalForm,No%>"></asp:Label>
                        </div>
                        <div id="divBuyCTPLCheck" class="proposal-row-full" style="display: none;">
                            <%--<asp:CheckBox ID="chkBuyCTPL" onclick="CheckedChanged();" runat="server" Text="" />--%>
                            <asp:CheckBox ID="chkBuyCTPL" runat="server" Text="" />
                            <%=GetGlobalResourceObject("ProposalForm", "CIAct")%>
                            <div style="display: none">
                                <asp:TextBox ID="txtBuyCTPL" runat="server" />
                            </div>
                        </div>
                        <div id="divBuyCTPL" style="display: none;">
                            <div class="proposal-col">
                                <%=GetGlobalResourceObject("ProposalForm", "CTPLAmount")%>:
                            </div>
                            <div class="proposal-row">
                                <asp:Label ID="lblCTPLAmount" runat="server" Font-Bold="true"></asp:Label>
                            </div>
                            <div style="display: none;">
                                <asp:TextBox ID="txtCTPL" runat="server" size="15" ReadOnly="true"></asp:TextBox>
                            </div>
                        </div>
                    </div>
                    <div class="pro-col-2">
                        <asp:UpdatePanel ID="upnlDriver" EnableViewState="true" runat="server">
                            <ContentTemplate>
                                <div class="proposal-col">
                                    <span style="color: #FF0004">*</span>
                                    <%=GetGlobalResourceObject("CarInsurance", "SpecifyNamedDriver")%>:</div>
                                <div class="proposal-row">
                                    <asp:RadioButton ID="rdoYesAddDriver" runat="server" GroupName="adddriver" AutoPostBack="true"
                                        OnCheckedChanged="rdoYesAddDriver_CheckedChanged" />
                                    &nbsp;<asp:Label ID="lblYesAddDriver" runat="server" Text="<%$ Resources:ProposalForm,Yes%>"></asp:Label>
                                    <asp:RadioButton ID="rdoNoAddDriver" runat="server" GroupName="adddriver" AutoPostBack="true"
                                        OnCheckedChanged="rdoNoAddDriver_CheckedChanged" Checked="true" />
                                    &nbsp;<asp:Label ID="lblNoAddDriver" runat="server" Text="<%$ Resources:ProposalForm,No%>"></asp:Label>
                                </div>
                                <div id="divNoofDriver" runat="server" visible="false">
                                    <div class="proposal-col">
                                        <span style="color: #FF0004">*</span><%=GetGlobalResourceObject("CarInsurance", "NoOfNamedDrivers")%>:</div>
                                    <div class="proposal-row">
                                        <asp:DropDownList CausesValidation="false" AutoPostBack="true" CssClass="proposal-combo"
                                            ID="ddlDriverCount" runat="server" OnSelectedIndexChanged="ddlDriverCount_SelectedIndexChanged">
                                            <asp:ListItem>1</asp:ListItem>
                                            <asp:ListItem>2</asp:ListItem>
                                        </asp:DropDownList>
                                    </div>
                                </div>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
                <asp:UpdatePanel ID="UpdatePanel1" EnableViewState="true" runat="server">
                    <ContentTemplate>
                        <asp:Panel ID="pnlDriverDetails" runat="server" Visible="false">
                            <div class="pro-form-row">
                                <asp:Panel ID="pnlDriver1" runat="server">
                                    <div class="proposal-heading">
                                        <asp:Label ID="lblDriverNo1" runat="server" Text="<%$ Resources:ProposalForm,DriverNo1%>"></asp:Label>
                                        <div style="display: none;">
                                            <asp:Label ID="lblDriverId1" Visible="false" runat="server"></asp:Label></div>
                                    </div>
                                    <div class="pro-col-1">
                                        <div class="proposal-col">
                                            <span style="color: #FF0004">*</span>
                                            <%=GetGlobalResourceObject("General", "Name")%>:</div>
                                        <div class="proposal-row">
                                            <asp:TextBox ID="txtDriverName1" MaxLength="50" runat="server" CssClass="proposal-fields"></asp:TextBox>
                                            <asp:RequiredFieldValidator CssClass="validationError" ID="rfvDriverName1" ValidationGroup="proposal"
                                                runat="server" ControlToValidate="txtDriverName1" ErrorMessage=""></asp:RequiredFieldValidator>
                                        </div>
                                        <div class="proposal-col">
                                            <span style="color: #FF0004">*</span>
                                            <%=GetGlobalResourceObject("ProposalForm", "DriverDOB")%>:</div>
                                        <div class="proposal-row">
                                            <asp:DropDownList ID="ddlDayDOB1" runat="server" CssClass="proposal-combo" Width="65">
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvDayDOB1" ControlToValidate="ddlDayDOB1" runat="server"
                                                CssClass="validationError" ValidationGroup="proposal" ErrorMessage="" InitialValue="-1"></asp:RequiredFieldValidator>
                                            <asp:DropDownList ID="ddlMonthDOB1" runat="server" CssClass="proposal-combo" Width="95">
                                                <asp:ListItem Value="-1" Text="<%$ Resources:General,Month%>"></asp:ListItem>
                                                <asp:ListItem Value="1" Text="<%$ Resources:MonthResource,January%>" />
                                                <asp:ListItem Value="2" Text="<%$ Resources:MonthResource,February%>" />
                                                <asp:ListItem Value="3" Text="<%$ Resources:MonthResource,March%>" />
                                                <asp:ListItem Value="4" Text="<%$ Resources:MonthResource,April%>" />
                                                <asp:ListItem Value="5" Text="<%$ Resources:MonthResource,May%>" />
                                                <asp:ListItem Value="6" Text="<%$ Resources:MonthResource,June%>" />
                                                <asp:ListItem Value="7" Text="<%$ Resources:MonthResource,July%>" />
                                                <asp:ListItem Value="8" Text="<%$ Resources:MonthResource,August%>" />
                                                <asp:ListItem Value="9" Text="<%$ Resources:MonthResource,September%>" />
                                                <asp:ListItem Value="10" Text="<%$ Resources:MonthResource,October%>" />
                                                <asp:ListItem Value="11" Text="<%$ Resources:MonthResource,November%>" />
                                                <asp:ListItem Value="12" Text="<%$ Resources:MonthResource,December%>" />
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvMonthDOB1" ControlToValidate="ddlMonthDOB1" runat="server"
                                                CssClass="validationError" ValidationGroup="proposal" ErrorMessage="" InitialValue="-1"></asp:RequiredFieldValidator>
                                            <asp:DropDownList ID="ddlYearDOB1" runat="server" CssClass="proposal-combo" Width="70">
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvYearDOB1" ControlToValidate="ddlYearDOB1" runat="server"
                                                CssClass="validationError" ValidationGroup="proposal" ErrorMessage="" InitialValue="-1"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                    <div class="pro-col-2">
                                        <div class="proposal-col">
                                            <span style="color: #FF0004"></span>
                                            <%=GetGlobalResourceObject("ProposalForm", "LicenseNumber")%>:</div>
                                        <div class="proposal-row">
                                            <asp:TextBox ID="txtDrivingLicenseNumber1" MaxLength="50" runat="server" CssClass="proposal-fields"></asp:TextBox>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </div>
                            <div class="pro-form-row">
                                <asp:Panel ID="pnlDriver2" runat="server" Width="100%">
                                    <div class="proposal-heading">
                                        <asp:Label ID="lblDriverNo2" runat="server" Text="<%$ Resources:ProposalForm,DriverNo2%>"></asp:Label>
                                        <div style="display: none;">
                                            <asp:Label ID="lblDriverId2" Visible="false" runat="server"></asp:Label></div>
                                    </div>
                                    <div class="pro-col-1">
                                        <div class="proposal-col">
                                            <span style="color: #FF0004">*</span>
                                            <%=GetGlobalResourceObject("General", "Name")%>:</div>
                                        <div class="proposal-row">
                                            <asp:TextBox ID="txtDriverName2" MaxLength="50" runat="server" CssClass="proposal-fields"></asp:TextBox>
                                            <asp:RequiredFieldValidator CssClass="validationError" ID="rfvDriverName2" ValidationGroup="proposal"
                                                runat="server" ControlToValidate="txtDriverName2" ErrorMessage=""></asp:RequiredFieldValidator>
                                        </div>
                                        <div class="proposal-col">
                                            <span style="color: #FF0004">*</span>
                                            <%=GetGlobalResourceObject("ProposalForm", "DriverDOB")%>:</div>
                                        <div class="proposal-row">
                                            <asp:DropDownList ID="ddlDayDOB2" runat="server" CssClass="proposal-combo" Width="65">
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvDayDOB2" ControlToValidate="ddlDayDOB2" runat="server"
                                                CssClass="validationError" ValidationGroup="proposal" ErrorMessage="" InitialValue="-1"></asp:RequiredFieldValidator>
                                            <asp:DropDownList ID="ddlMonthDOB2" runat="server" CssClass="proposal-combo" Width="95">
                                                <asp:ListItem Value="-1" Text="<%$ Resources:General,Month%>"></asp:ListItem>
                                                <asp:ListItem Value="1" Text="<%$ Resources:MonthResource,January%>" />
                                                <asp:ListItem Value="2" Text="<%$ Resources:MonthResource,February%>" />
                                                <asp:ListItem Value="3" Text="<%$ Resources:MonthResource,March%>" />
                                                <asp:ListItem Value="4" Text="<%$ Resources:MonthResource,April%>" />
                                                <asp:ListItem Value="5" Text="<%$ Resources:MonthResource,May%>" />
                                                <asp:ListItem Value="6" Text="<%$ Resources:MonthResource,June%>" />
                                                <asp:ListItem Value="7" Text="<%$ Resources:MonthResource,July%>" />
                                                <asp:ListItem Value="8" Text="<%$ Resources:MonthResource,August%>" />
                                                <asp:ListItem Value="9" Text="<%$ Resources:MonthResource,September%>" />
                                                <asp:ListItem Value="10" Text="<%$ Resources:MonthResource,October%>" />
                                                <asp:ListItem Value="11" Text="<%$ Resources:MonthResource,November%>" />
                                                <asp:ListItem Value="12" Text="<%$ Resources:MonthResource,December%>" />
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvMonthDOB2" ControlToValidate="ddlMonthDOB2" runat="server"
                                                CssClass="validationError" ValidationGroup="proposal" ErrorMessage="" InitialValue="-1"></asp:RequiredFieldValidator>
                                            <asp:DropDownList ID="ddlYearDOB2" runat="server" CssClass="proposal-combo" Width="70">
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvYearDOB2" ControlToValidate="ddlYearDOB2" runat="server"
                                                CssClass="validationError" ValidationGroup="proposal" ErrorMessage="" InitialValue="-1"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                    <div class="pro-col-2">
                                        <div class="proposal-col">
                                            <span style="color: #FF0004"></span>
                                            <%=GetGlobalResourceObject("ProposalForm", "LicenseNumber")%>:</div>
                                        <div class="proposal-row">
                                            <asp:TextBox ID="txtDrivingLicenseNumber2" MaxLength="50" runat="server" CssClass="proposal-fields"></asp:TextBox>
                                        </div>
                                    </div>
                                </asp:Panel>
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <div class="proposal-two-row">
                    <div class=" sub-heading">
                        <%=GetGlobalResourceObject("ProposalForm", "PaymentMode")%></div>
                    <div style="padding-bottom: 10px;">
                        <div class="left" id="divPremiumWCTPL">
                            <%=GetGlobalResourceObject("ProposalForm", "TotalPremium")%>: <strong>
                                <asp:Label ID="lblTotalPremiumPlusCtpl" runat="server"></asp:Label></strong>
                        </div>
                        <div class="left" id="divPremiumWOCTPL">
                            <%=GetGlobalResourceObject("ProposalForm", "TotalPremium")%>: <strong>
                                <asp:Label ID="lblTotalPremium" runat="server"></asp:Label></strong>
                        </div>
                        <div id="divMonthlyPremium">
                            <div>
                                <%=GetGlobalResourceObject("ProposalForm", "Premium")%>:</div>
                            <div class="left" id="divPremiumMonthlyWCTPL">
                                <strong>
                                    <asp:Label ID="lblPremiumMonthlyPlusCtpl" runat="server"></asp:Label></strong>
                            </div>
                            <div class="left" id="divPremiumMonthlyWOCTPL">
                                <strong>
                                    <asp:Label ID="lblPremiumMonthly" runat="server"></asp:Label></strong>
                            </div>
                        </div>
                    </div>
                    <div class="radius-box-payment" id="divPayOption">
                        <span style="color: #FF0004">*</span>
                        <%=GetGlobalResourceObject("ProposalForm", "PaymentType")%>: <span id="divBankIn">
                            <asp:RadioButton onclick="ValCheckPaymentType();CheckPaymentTypeValidationCss();ShowHideDiv('divBankInMessage',true);"
                                ID="rdoBankIn" runat="server" GroupName="paymenttype" />
                            &nbsp;<asp:Label ID="lblBankIn" runat="server" Text="<%$ Resources:ProposalForm,BankIn%>"></asp:Label>
                        </span><span>&nbsp;&nbsp;</span> <span id="divCreditCard">
                            <asp:RadioButton onclick="ValCheckPaymentType();CheckPaymentTypeValidationCss();ShowHideDiv('divBankInMessage',false);"
                                ID="rdoCreditCard" runat="server" GroupName="paymenttype" />
                            &nbsp;<asp:Label ID="lblCreditCard" runat="server" Text="<%$ Resources:ProposalForm,CreditCard%>"></asp:Label>
                        </span>&nbsp;&nbsp;</span><span id="divSevenEleven" style="display:none;">
                            <asp:RadioButton onclick="ValCheckPaymentType();CheckPaymentTypeValidationCss();ShowHideDiv('divBankInMessage',false);"
                                ID="rdoSevenEleven" runat="server" GroupName="paymenttype" />
                            &nbsp;<asp:Label ID="lblSevenEleven" runat="server" Text="<%$ Resources:ProposalForm,SevenEleven%>"></asp:Label>
                        </span><span>&nbsp;&nbsp;</span><span id="divTesco">
                            <asp:RadioButton onclick="ValCheckPaymentType();CheckPaymentTypeValidationCss();ShowHideDiv('divBankInMessage',false);"
                                ID="rdoTesco" runat="server" GroupName="paymenttype" />
                            &nbsp;<asp:Label ID="lblTesco" runat="server" Text="<%$ Resources:ProposalForm,Tesco%>"></asp:Label>
                        </span><span>&nbsp;&nbsp;</span><span id="divTrueMoney">
                            <asp:RadioButton onclick="ValCheckPaymentType();CheckPaymentTypeValidationCss();ShowHideDiv('divBankInMessage',false);"
                                ID="rdoTrueMoney" runat="server" GroupName="paymenttype" />
                            &nbsp;<asp:Label ID="lblTrueMoney" runat="server" Text="<%$ Resources:ProposalForm,TrueMoney%>"></asp:Label>
                        </span><span style="display: none">
                            <asp:TextBox ID="txtPaymentType" runat="server"></asp:TextBox></span>
                        <asp:RequiredFieldValidator ID="rfvPaymentType" runat="server" CssClass="validationError"
                            Display="Dynamic" ErrorMessage="" ControlToValidate="txtPaymentType" ValidationGroup="proposal"
                            Text=""></asp:RequiredFieldValidator>
                        <div class="clear">
                        </div>
                    </div>
                    <div id="divBankInMessage">
                        <br />
                        <%=GetGlobalResourceObject("ProposalForm", "BankInMsg1")%><br />
                        <br />
                        <%=GetGlobalResourceObject("ProposalForm", "BankInMsg2")%>
                        <b>
                            <%=GetGlobalResourceObject("ProposalForm", "BankInMsg3")%></b><br />
                        <asp:RadioButtonList ID="rdoBankInOption" runat="server">
                            <asp:ListItem Text="<%$Resources:ProposalForm,BankInBKK%>" Value="BKK" Selected="True"></asp:ListItem>
                            <asp:ListItem Text="<%$Resources:ProposalForm,BankInKBank%>" Value="KBANK"></asp:ListItem>
                            <asp:ListItem Text="<%$Resources:ProposalForm,BankInKTB%>" Value="KTB"></asp:ListItem>
                            <asp:ListItem Text="<%$Resources:ProposalForm,BankInSCB%>" Value="SCB"></asp:ListItem>
                        </asp:RadioButtonList>
                        <%=GetGlobalResourceObject("ProposalForm", "BankInMsg5")%><br />
                        <br />
                        <%=GetGlobalResourceObject("ProposalForm", "BankInMsg7")%><br />
                        <%=GetGlobalResourceObject("ProposalForm", "BankInMsg8")%><br />
                        <%=GetGlobalResourceObject("ProposalForm", "BankInMsg9")%><br />
                    </div>
                </div>
                <div id="divDisclaimerTab" style="display: none" runat="server">
                    <div class="seperator">
                    </div>
                    <div style="float: left; width: 3%" id="divDisclaimer">
                        &nbsp;&nbsp;<asp:CheckBox runat="server" ID="chkDisclaimer" onclick="RemoveValidateCss(this);"
                            ValidationGroup="proposal" /></div>
                    <div style="float: left; width: 94%">
                        <asp:Label runat="server" ID="lblDisclaimerMessage" Font-Size="16px" ForeColor="White"
                            Font-Bold="true" Text="<%$Resources:ProposalForm,Disclaimer%>"></asp:Label>
                    </div>
                    <div class="seperator">
                    </div>
                    <div>
                        <asp:CustomValidator ID="cust_Disclaimer" runat="server" ErrorMessage="" ValidationGroup="proposal"
                            ClientValidationFunction="ValidateCheckBox"><%=GetGlobalResourceObject("ProposalForm", "MessageDisclaimer")%></asp:CustomValidator></div>
                </div>
                <div class="proposal-two-row">
                    <div style="padding-top: 10px;">
                        <img src="/images/warning.png" width="21" height="18" alt="" />
                        <asp:Label runat="server" ID="lblnote" Text="<%$Resources:CarInsuranceProposal,ProposalNote%>"></asp:Label>
                    </div>
                    <div style="float: left !important;">
                        <asp:Button ID="btnSubmit" runat="server" CssClass="action-button" Text="<%$Resources:General,SubmitCap %>"
                            ValidationGroup="proposal" OnClientClick="LoadValidationErrorCss();CheckOptionValidationCss();CheckPaymentOption();if (Page_ClientValidate('proposal')){this.removeAttribute('onmouseout');this.removeAttribute('onmouseup');this.className = 'action-button-processing';}"
                            OnClick="btnSubmit_Click" Width="150" />
                    </div>
                    <asp:Button ID="Button1" runat="server" CssClass="print-btn" Text="<%$Resources:General,Print %>"
                        OnClientClick="window.print(); return false;" />
                </div>
                <div style="display: none;">
                    <div id="divEngine" style="display: none;">
                        <div>
                            <span class="red"></span>
                            <%=GetGlobalResourceObject("ProposalForm", "EngineNumber")%>:</div>
                        <div class="left">
                            <asp:TextBox ID="txtEngineNumber" MaxLength="50" runat="server" size="25"></asp:TextBox>&nbsp;
                        </div>
                    </div>
                    <div id="divChassis" style="display: none;">
                        <div>
                            <span class="red"></span>
                            <%=GetGlobalResourceObject("ProposalForm", "ChassisNumber")%>:</div>
                        <div class="left">
                            <asp:TextBox ID="txtChassisNumber" MaxLength="50" runat="server" size="25"></asp:TextBox>&nbsp;
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="footer-bg-2">
        (C) 2014 GluayGluay.com - All rights reserved</div>

    <script type="text/javascript">

        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_initializeRequest(InitializeRequest);
        prm.add_endRequest(EndRequest);
        var postBackElement;
        function InitializeRequest(sender, args) {
            if (prm.get_isInAsyncPostBack())
                args.set_cancel(true);
            postBackElement = args.get_postBackElement();

        }

        function OnOffUpdateProgress(onOff) {
        }

        function EndRequest(sender, args) {
        }


        function ShowHideDiv(divName, varOnOff) {
            if (varOnOff) {
                document.getElementById(divName).style.display = "";
            }
            else {
                document.getElementById(divName).style.display = "none";
            }
        }

        function CheckOptionValidationCss() {
            CheckPaymentTypeValidationCss();
            CheckedChanged();
        }

        function CheckValidationCss(divYes, divNo, ctrlText, valCtrl) {
            ShowValidationEffectOption(divYes, divNo, ctrlText, valCtrl);
            return true;
        }

        function CheckPaymentTypeValidationCss() {
            CheckPaymentOption();
            CheckValidationCss('divBankIn', 'divCreditCard', '<%=txtPaymentType.ClientID%>', '<%=rfvPaymentType.ClientID%>');
        }

        function ValCheckPaymentType(varOnOff) {
            var txtCtrl = document.getElementById("<%=txtPaymentType.ClientID%>");
            txtCtrl.value = "1";
        }

        function CheckAll() {
        }

        function CheckPaymentOption() {
            var txtPO = document.getElementById('<%=txtPaymentType.ClientID%>');
            if (txtPO.value == '')
                divPayOption.className = 'radius-box-payment-error';
            else
                divPayOption.className = 'radius-box-payment';

        }

        function showhide(el) {

            el = document.getElementById(el);
            el.style.display = (el.style.display == "none") ? "block" : "none";
        }

        window.onload = function() {
            showhide('divPremiumMonthlyWCTPL');
            showhide('divPremiumMonthlyWOCTPL');
            showhide('divBankInMessage');
            onloading();
        }

        function onloading() {
            CheckedChanged();
            ShowHideDiv('divPremiumMonthlyWCTPL', false);
            ShowHideDiv('divPremiumMonthlyWOCTPL', true);
            if (document.getElementById('<%=rdoBankIn.ClientID%>').checked == true) {
                ShowHideDiv('divBankInMessage', true);
            }
            else if (document.getElementById('<%=rdoCreditCard.ClientID%>').checked == true) {
                ShowHideDiv('divBankInMessage', false);
            }
            else {
                ShowHideDiv('divBankInMessage', false);
            }

        }

        function restrictToNumbers(e) {
            if ([e.keyCode || e.which] == 8 || [e.keyCode || e.which] == 37 || [e.keyCode || e.which] == 9 || [e.keyCode || e.which] == 39) //this is to allow backspace
                return true;

            if ([e.keyCode || e.which] < 48 || [e.keyCode || e.which] > 57)
                e.preventDefault ? e.preventDefault() : e.returnValue = false;
        }

    </script>

    <script type="text/javascript">

        function CheckedChanged() {
            ShowHideDiv('divBuyCTPLCheck', false);
            ShowHideDiv('divBuyCTPL', false);
            ShowHideDiv('divPremiumWCTPL', false);
            ShowHideDiv('divPremiumWOCTPL', true);
            ShowHideDiv('divMonthlyPremium', false);
            ShowHideDiv('divPremiumMonthlyWCTPL', false);
            ShowHideDiv('divPremiumMonthlyWOCTPL', false);
//            var ctrlCMI = document.getElementById('<=txtIsIncludeCMI.ClientID>');
//            if (ctrlCMI.value == '0') {
//                ShowHideDiv('divBuyCTPLCheck', true);
//                var ctrlTxt = document.getElementById('<=txtBuyCTPL.ClientID>');
//                var ctrlY = document.getElementById('<=chkBuyCTPL.ClientID>');
//                if (ctrlY.checked == true) {
//                    ShowHideDiv('divBuyCTPL', true);
//                    ctrlTxt.value = '1';
//                    ShowHideDiv('divPremiumWCTPL', true);
//                    ShowHideDiv('divPremiumWOCTPL', false);
//                    ShowHideDiv('divMonthlyPremium', false);
//                    ShowHideDiv('divPremiumMonthlyWCTPL', false);
//                    ShowHideDiv('divPremiumMonthlyWOCTPL', false);
//                }
//                else {
//                    ShowHideDiv('divBuyCTPL', false);
//                    ctrlTxt.value = '0';
//                    ShowHideDiv('divPremiumWCTPL', false);
//                    ShowHideDiv('divPremiumWOCTPL', true);
//                    ShowHideDiv('divMonthlyPremium', false);
//                    ShowHideDiv('divPremiumMonthlyWCTPL', false);
//                    ShowHideDiv('divPremiumMonthlyWOCTPL', false);
//                }
//            }
//            else {
//                ShowHideDiv('divBuyCTPLCheck', false);
//                ShowHideDiv('divBuyCTPL', false);
//                ShowHideDiv('divPremiumWCTPL', false);
//                ShowHideDiv('divPremiumWOCTPL', true);
//                ShowHideDiv('divMonthlyPremium', false);
//                ShowHideDiv('divPremiumMonthlyWCTPL', false);
//                ShowHideDiv('divPremiumMonthlyWOCTPL', false);
//            }
        }

        function ValidateCheckBox(source, args) {
            var chkListModules = document.getElementById('<%= chkDisclaimer.ClientID %>');
            var divDis = document.getElementById('divDisclaimer');
            var flag = divDis.className.indexOf("validationError") != -1;
            if (chkListModules.checked) {
                args.IsValid = true;
                if (flag) {
                    divDis.className = divDis.className.replace(new RegExp("\\b" + "validationError" + "\\b", "i"), "").replace(/^\s+|\s(?=\s+)|\s+$/m, "");
                }
            }
            else {
                args.IsValid = false;
                if (!flag) {
                    divDis.className += (divDis.className.length != 0 ? " " : "") + "validationError";
                }
            }
        }

        function RemoveValidateCss(obj) {
            var divDis = document.getElementById('divDisclaimer');
            var flag = divDis.className.indexOf("validationError") != -1;
            if (obj.checked) {
                if (flag) {
                    divDis.className = divDis.className.replace(new RegExp("\\b" + "validationError" + "\\b", "i"), "").replace(/^\s+|\s(?=\s+)|\s+$/m, "");
                }
            }
            else {
                if (!flag) {
                    divDis.className += (divDis.className.length != 0 ? " " : "") + "validationError";
                }
            }
        }
           
    </script>

    <script type="text/javascript">
        function SubmitConfirm() {
            var _retVal = false;
            if (Page_ClientValidate('proposal')) {
                _retVal = confirm('By pressing the submit button, you authorise CompareXpress to send your personal information to the partipating merchant of your choice. You therefore exempt CompareXpress from any liability relating to the sharing of this information with our participating merchant.');
            }
            return _retVal;
        }
        IncreaseProgress(100);
        HideLoading();
    </script>

    <script type="text/javascript">
        $(document).ready(function() {
            $('#<%=ddlDistrict.ClientID %>').attr('disabled', 'disabled');
            $('#<%=ddlSubDistrict.ClientID %>').attr('disabled', 'disabled');
            $('#<%=ddlDistrict.ClientID %>').append('<option selected="selected" value="-1">' + '<%=GetGlobalResourceObject("CarInsurance", "Select")%>' + '</option>');
            $('#<%=ddlSubDistrict.ClientID %>').empty().append('<option selected="selected" value="-1">' + '<%=GetGlobalResourceObject("CarInsurance", "Select")%>' + '</option>');


            $('#<%=ddlProvince.ClientID %>').change(function() {
                var provinceid = $('#<%=ddlProvince.ClientID%>').val();
                $('#<%=ddlDistrict.ClientID %>').removeAttr("disabled");
                $('#<%=ddlSubDistrict.ClientID %>').empty().append('<option selected="selected" value="-1">' + '<%=GetGlobalResourceObject("CarInsurance", "Select")%>' + '</option>');
                $('#<%=ddlSubDistrict.ClientID %>').attr('disabled', 'disabled');
                $.ajax({
                    type: "POST",
                    url: '<%= ConfigurationManager.AppSettings["TH.HostName"].ToString()%>' + '/car-insurance/proposalforms/getaddress.aspx/BindDistrict',
                    data: "{'provinceid':'" + provinceid + "', 'language': '" + '<%=Session["Language"].ToString()%>' + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(msg) {
                        var j = jQuery.parseJSON(msg.d);
                        var options;
                        for (var i = 0; i < j.length; i++) {
                            options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'
                        }
                        $('#<%=ddlDistrict.ClientID %>').html(options)
                        $('#<%=hidDistrict.ClientID%>').val('-1');
                        $('#<%=hidDistrictName.ClientID%>').val('');
                        $('#<%=hidSubDistrict.ClientID%>').val('-1');
                        $('#<%=hidSubDistrictName.ClientID%>').val('');
                    },
                    error: function(data) {
                        alert('Network connection failed. Please try again!')
                    }
                });
            });
            $('#<%=ddlDistrict.ClientID %>').change(function() {
                var districtid = $('#<%=ddlDistrict.ClientID%>').val();
                $('#<%=ddlSubDistrict.ClientID %>').removeAttr("disabled");
                $.ajax({
                    type: "POST",
                    url: '<%= ConfigurationManager.AppSettings["TH.HostName"].ToString()%>' + '/car-insurance/proposalforms/getaddress.aspx/BindSubDistrict',
                    data: "{'districtid':'" + districtid + "', 'language': '" + '<%=Session["Language"].ToString()%>' + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(msg) {
                        var j = jQuery.parseJSON(msg.d);
                        var options;
                        for (var i = 0; i < j.length; i++) {
                            options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'
                        }
                        $('#<%=ddlSubDistrict.ClientID %>').html(options)

                        $('#<%=hidDistrict.ClientID%>').val(districtid);

                        var districtname = $('#<%=ddlDistrict.ClientID%>' + ' option:selected').text();
                        $('#<%=hidDistrictName.ClientID%>').val(districtname);

                        $('#<%=hidSubDistrict.ClientID%>').val('-1');
                        $('#<%=hidSubDistrictName.ClientID%>').val('');
                        $('#<%=ddlDistrict.ClientID%>').removeClass("validationError");
                    },
                    error: function(data) {
                        alert('Network connection failed. Please try again!')
                    }
                });
            });

            $('#<%=ddlSubDistrict.ClientID %>').change(function() {
                var subdistrictid = $('#<%=ddlSubDistrict.ClientID%>').val();
                $.ajax({
                    type: "POST",
                    url: '<%= ConfigurationManager.AppSettings["TH.HostName"].ToString()%>' + '/car-insurance/proposalforms/getaddress.aspx/SetPostCode',
                    data: "{'subdistrictid':'" + subdistrictid + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(msg) {
                        var j = jQuery.parseJSON(msg.d);
                        $('#<%=txtPostalCode.ClientID%>').val(j);
                        $('#<%=hidSubDistrict.ClientID%>').val(subdistrictid);

                        var subdistrictname = $('#<%=ddlSubDistrict.ClientID%>' + ' option:selected').text();
                        $('#<%=hidSubDistrictName.ClientID%>').val(subdistrictname);

                        $('#<%=ddlSubDistrict.ClientID%>').removeClass("validationError");
                    },
                    error: function(data) {
                        alert('Network connection failed. Please try again!')
                    }
                });
            });
        })

        ////////////mailingaddress///////////
        $(document).ready(function() {
            $('#<%=ddlMailingDistrict.ClientID %>').attr('disabled', 'disabled');
            $('#<%=ddlMailingSubDistrict.ClientID %>').attr('disabled', 'disabled');
            $('#<%=ddlMailingDistrict.ClientID %>').append('<option selected="selected" value="-1">' + '<%=GetGlobalResourceObject("CarInsurance", "Select")%>' + '</option>');
            $('#<%=ddlMailingSubDistrict.ClientID %>').empty().append('<option selected="selected" value="-1">' + '<%=GetGlobalResourceObject("CarInsurance", "Select")%>' + '</option>');
            $('#<%=ddlMailingProvince.ClientID %>').change(function() {
                var provinceid = $('#<%=ddlMailingProvince.ClientID%>').val();
                $('#<%=ddlMailingDistrict.ClientID %>').removeAttr("disabled");
                $('#<%=ddlMailingSubDistrict.ClientID %>').empty().append('<option selected="selected" value="-1">' + '<%=GetGlobalResourceObject("CarInsurance", "Select")%>' + '</option>');
                $('#<%=ddlMailingSubDistrict.ClientID %>').attr('disabled', 'disabled');
                $.ajax({
                    type: "POST",
                    url: '<%= ConfigurationManager.AppSettings["TH.HostName"].ToString()%>' + '/car-insurance/proposalforms/getaddress.aspx/BindDistrict',
                    data: "{'provinceid':'" + provinceid + "', 'language': '" + '<%=Session["Language"].ToString()%>' + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(msg) {
                        var j = jQuery.parseJSON(msg.d);
                        var options;
                        for (var i = 0; i < j.length; i++) {
                            options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'
                        }
                        $('#<%=ddlMailingDistrict.ClientID %>').html(options)
                        $('#<%=hidMailingDistrict.ClientID%>').val('-1');
                        $('#<%=hidMailingDistrictName.ClientID%>').val('');

                        $('#<%=hidMailingSubDistrict.ClientID%>').val('-1');
                        $('#<%=hidMailingSubDistrictName.ClientID%>').val('');
                    },
                    error: function(data) {
                        alert('Network connection failed. Please try again!')
                    }
                });
            });
            $('#<%=ddlMailingDistrict.ClientID %>').change(function() {
                var districtid = $('#<%=ddlMailingDistrict.ClientID%>').val();
                $('#<%=ddlMailingSubDistrict.ClientID %>').removeAttr("disabled");
                $.ajax({
                    type: "POST",
                    url: '<%= ConfigurationManager.AppSettings["TH.HostName"].ToString()%>' + '/car-insurance/proposalforms/getaddress.aspx/BindSubDistrict',
                    data: "{'districtid':'" + districtid + "', 'language': '" + '<%=Session["Language"].ToString()%>' + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(msg) {
                        var j = jQuery.parseJSON(msg.d);
                        var options;
                        for (var i = 0; i < j.length; i++) {
                            options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>'
                        }
                        $('#<%=ddlMailingSubDistrict.ClientID %>').html(options)

                        $('#<%=hidMailingDistrict.ClientID%>').val(districtid);

                        var mailingdistrictname = $('#<%=ddlMailingDistrict.ClientID%>' + ' option:selected').text();
                        $('#<%=hidMailingDistrictName.ClientID%>').val(mailingdistrictname);

                        $('#<%=hidMailingSubDistrict.ClientID%>').val('-1');
                        $('#<%=hidMailingSubDistrictName.ClientID%>').val('');

                        $('#<%=ddlMailingDistrict.ClientID%>').removeClass("validationError");
                    },
                    error: function(data) {
                        alert('Network connection failed. Please try again!')
                    }
                });
            });

            $('#<%=ddlMailingSubDistrict.ClientID %>').change(function() {
                var subdistrictid = $('#<%=ddlMailingSubDistrict.ClientID%>').val();
                $.ajax({
                    type: "POST",
                    url: '<%= ConfigurationManager.AppSettings["TH.HostName"].ToString()%>' + '/car-insurance/proposalforms/getaddress.aspx/SetPostCode',
                    data: "{'subdistrictid':'" + subdistrictid + "'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(msg) {
                        var j = jQuery.parseJSON(msg.d);
                        $('#<%=txtMailingPostalCode.ClientID%>').val(j);
                        $('#<%=hidMailingSubDistrict.ClientID%>').val(subdistrictid);

                        var mailingsubdistrictname = $('#<%=ddlMailingSubDistrict.ClientID%>' + ' option:selected').text();
                        $('#<%=hidMailingSubDistrictName.ClientID%>').val(mailingsubdistrictname);

                        $('#<%=ddlMailingSubDistrict.ClientID%>').removeClass("validationError");
                    },
                    error: function(data) {
                        alert('Network connection failed. Please try again!')
                    }
                });
            });
        })

        /////rdomailingCheck/////
        $(function() {
            ValidatorEnable(document.getElementById('<%=rfvMailingAddress.ClientID %>'), false);
            ValidatorEnable(document.getElementById('<%=rfvMailingProvince.ClientID %>'), false);
            ValidatorEnable(document.getElementById('<%=rfvMailingDistrict.ClientID %>'), false);
            ValidatorEnable(document.getElementById('<%=rfvMailingSubDistrict.ClientID %>'), false);
            ValidatorEnable(document.getElementById('<%=rfvMailingPostalCode.ClientID %>'), false);


            $("#<%=rdoMailingAddressYes.ClientID %>, #<%=rdoMailingAddressNo.ClientID %>").change(function() {
                if ($('#<%=rdoMailingAddressYes.ClientID %>').is(":checked")) {
                    document.getElementById('<%=pnlMailingAddress.ClientID %>').style.display = 'none';
                    $('#<%=hidMailingAddress.ClientID %>').val("no");
                    ValidatorEnable(document.getElementById('<%=rfvMailingAddress.ClientID %>'), false);
                    ValidatorEnable(document.getElementById('<%=rfvMailingProvince.ClientID %>'), false);
                    ValidatorEnable(document.getElementById('<%=rfvMailingDistrict.ClientID %>'), false);
                    ValidatorEnable(document.getElementById('<%=rfvMailingSubDistrict.ClientID %>'), false);
                    ValidatorEnable(document.getElementById('<%=rfvMailingPostalCode.ClientID %>'), false);
                }
                else if ($('#<%=rdoMailingAddressNo.ClientID %>').is(":checked")) {
                    document.getElementById('<%=pnlMailingAddress.ClientID %>').style.display = '';
                    $('#<%=hidMailingAddress.ClientID %>').val("yes");
                    ValidatorEnable(document.getElementById('<%=rfvMailingAddress.ClientID %>'), true);
                    ValidatorEnable(document.getElementById('<%=rfvMailingProvince.ClientID %>'), true);
                    ValidatorEnable(document.getElementById('<%=rfvMailingDistrict.ClientID %>'), true);
                    ValidatorEnable(document.getElementById('<%=rfvMailingSubDistrict.ClientID %>'), true);
                    ValidatorEnable(document.getElementById('<%=rfvMailingPostalCode.ClientID %>'), true);
                }
            });
        });

        function LeaveConfirm() {
            var _retVal = false;
            _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmLeaving")%>');
            if (_retVal == true) {
                var Redirect = $('#<%=lblRedirect.ClientID%>').text();
                location.href = Redirect;
            }
        }
    </script>

</asp:Content>
